package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.WantGoodsCommentMapper;
import cn.duli.xianer.pojo.WantGoodsComment;
import cn.duli.xianer.service.WantGoodsCommentService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WantGoodsCommentServiceImpl implements WantGoodsCommentService {

    @Resource
    private WantGoodsCommentMapper wantGoodsCommentMapper;

    @Override
    public List<WantGoodsComment> findByWantGoodId(Integer wgId) {
        return wantGoodsCommentMapper.findByWantGoodId(wgId);
    }

    @Override
    public void save(WantGoodsComment wantGoodsComment) {
        wantGoodsCommentMapper.save(wantGoodsComment);
    }

    @Override
    public Page<WantGoodsComment> findByUserId(Integer uId) {
        return wantGoodsCommentMapper.findByUserId(uId);
    }

    @Override
    public void deleteById(Integer id) {
        wantGoodsCommentMapper.deleteById(id);
    }

    @Override
    public Page<WantGoodsComment> findAll() {
        return wantGoodsCommentMapper.findAll();
    }

    @Override
    public void deleteByParentId(Integer pId) {
        wantGoodsCommentMapper.deleteByParentId(pId);
    }

    @Override
    public List<WantGoodsComment> findByParentId(Integer pId) {
        return wantGoodsCommentMapper.findByParentId(pId);
    }

    @Override
    public int findAllCount() {
        return wantGoodsCommentMapper.findAllCount();
    }

    @Override
    public int findCountsByGid(Integer wgId) {
        return wantGoodsCommentMapper.findCountsByGid(wgId);
    }
}
